@extends('layouts.ajax_master')
@section('app_js')
@stop
@section('content')
    @if(empty($data))
        <!-- 购物车空 -->
<div class="shopping-none main">
    <div class="none-wrap">
        <i></i>
        <div class="info">
            购物车空空的哦~，去看看心仪的商品吧~<br/>
            <a href="javascript:;">去购物&#62</a>
        </div>
    </div>
    <script src="/resource/js/jquery-1.11.3.min.js"></script>
    <script>
        $(".delete-all").hide()
    </script>
</div>
    @else
            <!-- 购物车内容 -->
    <div class="title">
        <div class="til">全部商品<span>{{$count}}</span>个</div>
    </div>
    <div class="shopping-wrap">
        @foreach($data as $v)
            <div class="table info-font">
                <table>
                    <thead>
                    <tr>
                        <th width="">商品信息</th>
                        <th width="160px">库存</th>
                        <th width="220px">单价</th>
                        <th width="180px">数量</th>
                        <th width="200px">合计（元）</th>
                        <th width="170px">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>
                            <a href="javascript:;" target="blank"><img src="{{$v->product_img}}" alt=""></a>
                            <a href="javascript:;" target="blank">{{$v->product_name}}</a>
                        </td>
                        <td class="stock-num"><div>{{$v->stock}}{{$v->unit}}</div></td>
                        <td><div>￥{{$v->price}}</div></td>
                        <td>
                            <div class="info-num">
                                <a href="javascript:;" class="pre"></a>
                                <input type="text" id="info-num" placeholder="{{$v->number}}" value="{{$v->number}}">
                                <a href="javascript:;" class="next"></a>
                            </div>
                        </td>
                        <td><span>￥{{$v->price*$v->number}}</span></td>
                        <td>
                            <a href="javascript:;" class="a-delete" data-cart_id="{{ $v->cart_id }}">删除</a>
                            <a href="javascript:;" class="btn-accounts">去结算</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        @endforeach
    </div>
  @endif
